file(GLOB  FileList  *)
foreach(list  ${FileList})
if(IS_DIRECTORY ${list})
    string(REGEX MATCH "[^/\\]+[/\\]*$" rp ${list})
    message(STATUS  ${rp})
    file(GLOB  SRC  ${list}/*.cpp ${list}/*.c)
    add_executable(${rp} ${SRC})
    target_link_libraries(${rp} nanoco pthread)
    include_directories(../src)
endif()

endforeach(list)